﻿# -*- coding:utf-8 -*-
import matplotlib.pyplot as plt
import matplotlib.pyplot as mp
import matplotlib
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2Tk
from matplotlib.figure import Figure
x_data=['三','四','五']
y_data = [[88,99,66],[55,44,33],[22,11,77]]
name=['yuwen','shuxue','yingyu']

# 画图
plt.rcParams['font.sans-serif'] = 'SimHei'  # 全局字体
plt.xlabel('科目', size=10)
plt.ylabel('分数', size=10)
plt.title('图', size=10)
for i in range(len(y_data)):
    plt.plot(x_data, y_data[i],label=str(name[i]))
    for a, b in zip(x_data, y_data[i]):
        plt.text(a,b,b, ha='center', va='bottom', fontsize=10)
mp.legend(loc=9)
plt.grid(True)  # 网格
plt.show()